<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<sj:head />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Manage Yard Members</title>
</head>
<script type="text/javascript">
	//document.getElementById("hiddenButton").style.display = "none";
	//document.getElementById("hiddebButtonYard").style.display = "none";
</script>
<body>
<sj:div id="ManageMemberDiv">
	<s:form name="ManageMember" id="ManageMemberForm" action="showMember"
		theme="simple">
		<table width="99%" border="0" align="center" cellpadding="4" cellspacing="1">
			<tr class="alt">
				<td width="10%">Select OEM :</td>
				<td width="20%"><s:select id="oemType" name="oemType"
					list="oemList" listKey="oemId" listValue="oemName" headerKey="0"
					headerValue="Select OEM" onchange="$.publish('oemSelectedTopic')">
				</s:select> 
				
				</td>

				<td width="10%">Select Yard :</td>
				<td width="20%"><s:select label="Select Yard" headerKey="-1"
					headerValue="Select Yard" list="listYard" listKey="id"
					listValue="name" name="selectedYardId"
					onchange="$.publish('showMemberTopic')" /></td>
				<td width="20%"></td>
				<td align="right"><sj:submit value="CreateMember"
					name="CreateMember" cssClass="btnbg" href="showMemberDetail.action"
					targets="ManageMemberDiv" formIds="ManageMemberForm"></sj:submit></td>
			</tr>
		</table>
		<sj:div id="hiddenButton" cssStyle="display:none;">
			<sj:submit href="showMember.action" targets="ManageMemberDiv" formIds="ManageMemberForm" listenTopics="showMemberTopic" />
		</sj:div>
		
		<sj:div id="hiddebButtonYard" cssStyle="display:none;">
					<sj:submit formIds="ManageMemberForm" href="populateManageYard.action"
						listenTopics="oemSelectedTopic" targets="ManageMemberDiv"></sj:submit>
		</sj:div>
		<table width="99%" border="0" align="center" cellpadding="4"
			cellspacing="1" class="gridtable">
			<tr>
				<th colspan="4">All Available Yard Members</th>
			</tr>
			<s:iterator value="listMember">
				<s:url action='showMemberDetail' id="details">
					<s:param name="memberDTO.id" value="%{id}" />
					<s:param name="selectedYardId" value="selectedYardId" />
				</s:url>
				<tr class="alt">
					<td><sj:a href="%{details}" targets="ManageMemberDiv" formIds="ManageMemberForm">
						<s:property value="name" />
					</sj:a> <br />
					</td>
				</tr>
			</s:iterator>
		</table>
	</s:form>
</sj:div>
</body>
</html>